!function(e){WidgetOptsSelect2={_init:function(){e("select.widgetopts-select2").each(function(){if(e(this).select2({width:"100%",allowClear:!0,placeholder:" "}).on("change",e.proxy(WidgetOptsSelect2._maybePreview,this.context)).on("select2:unselecting",function(t){e(this).data("unselecting",!0)}).on("select2:open",function(t){e(this).data("unselecting")&&(e(this).removeData("unselecting"),e(this).select2("close"))}).on("select2:unselect",function(t){e(this).val()||e(this).val("").trigger("change")}),e(this).attr("multiple")){var t=e(this).siblings(".select2-container").first("ul.select2-selection__rendered");t.sortable({placeholder:"ui-state-highlight",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){e(e(t).find(".select2-selection__choice").get().reverse()).each(function(){var t=e(this).data("data").id,i=e(this).find('option[value="'+t+'"]')[0];e(this).prepend(i)})}})}})},_maybePreview:function(){var t={target:this};"refresh"==e(this).closest(".fl-field").data("preview").type&&FLBuilder.preview.delayPreview(t)}},FLBuilder.addHook("settings-form-init",function(){WidgetOptsSelect2._init()})}(jQuery);